# Maintainer: J. Peter Mugaas <jpmugaas@suddenlink.net>

_realname=more-itertools
pkgbase=python3-${_realname}
pkgname=("python3-${_realname}")
pkgver=7.2.0
pkgrel=1
pkgdesc='More routines for operating on iterables, beyond itertools'
arch=('any')
url='https://github.com/erikrose/more-itertools'
#url='https://pypi.python.org/pypi/more-itertools'
license=('MIT')
makedepends=('python3-setuptools')
depends=('python3')
source=("https://files.pythonhosted.org/packages/source/m/more-itertools/more-itertools-$pkgver.tar.gz")
sha512sums=('840b535bf5f2fc3cf9c4c0106f977f0b178049b95e5ccb6cf51b5e68d0a6afd77a577bb0d0af25ea8cdf4b7dd2ce9691754ba6c773a196f8b10dba5d7683c6b0')

prepare() {
  cd "${srcdir}"
  local builddir="python3-build-${CARCH}"
  rm -rf ${builddir} | true
  cp -r "${_realname}-${pkgver}" "${builddir}"
  # Set version for setuptools_scm
  export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
}

build() {
  msg "Python 3 build for ${CARCH}"
  cd "${srcdir}/python3-build-${CARCH}"
  python${pver} setup.py build
}

package() {
  cd "${srcdir}/python3-build-${CARCH}"
  python3 setup.py install --root="$pkgdir/" --optimize=0 --skip-build
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
